//
//  SortTableViewCell.m
//  RRIsSmallPig
//
//  Created by K。 on 15/7/22.
//  Copyright (c) 2015年 寇广超. All rights reserved.
//

#import "SortTableViewCell.h"

@implementation SortTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self createSubViews];
    }
    return self;
}

-(void)createSubViews{
    
    self.titleImage = [[UIImageView alloc]initWithFrame:CGRectMake(10, [UIScreen mainScreen].bounds.origin.y + 20 , 80, 80)];
    //self.titleImage.backgroundColor = [UIColor colorWithRed:0.2 green:0.3 blue:0.1 alpha:1.0];
    [self.contentView addSubview:_titleImage];
    
    
    self.nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(_titleImage.frame.origin.x + 150, _titleImage.frame.origin.y +10, _titleImage.frame.size.width +20, _titleImage.frame.size.height - 40)];
   // self.nameLabel.backgroundColor = [UIColor colorWithRed:0.4 green:0.2 blue:0.9 alpha:1.0];
    [self.contentView addSubview:_nameLabel];
    
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    [self.titleImage sd_setImageWithURL:[NSURL URLWithString:_sort.imagePath] placeholderImage:nil];
    self.nameLabel.text = _sort.name;

}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
